<?php
@require("php_config_init.php");
@require("php_config_mysql.php");
$usertel = $_GET["usertel"];
$userpwd = $_GET["userpwd"];
$userbirthday = $_GET["userbirthday"];
$sql = "select COUNT(*) from userinfo where usertel='$usertel' and status = 1";
$result = mysql_query($sql);
$item = mysql_fetch_array($result);
$obj = array();
if($item[0] > 0){
    $obj["code"] = 0;
    $obj["msg"] = "用户已存在";
}else{
    $sql = "insert into userinfo(usertel,userpwd,userbirthday) values ('$usertel','$userpwd','$userbirthday')";
    mysql_query($sql);
    $count = mysql_affected_rows();
    if($count > 0){
        $obj["code"] = 1;
        $obj["msg"] = "注册成功";
    }else{
        $obj["code"] = 0;
        $obj["msg"] = "注册失败";
    }
}
echo json_encode($obj);
?>